package com.kangyi.user.mapper;

import com.kangyi.user.annotation.AutoFill;
import com.kangyi.entity.NursingHomeReviewImage;
import com.kangyi.enumeration.OperationType;
import com.kangyi.vo.NursingHomeReviewImageVO;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Blank
 * @version 1.0
 */
@Mapper
public interface NursingHomeReviewImageMapper {

    List<NursingHomeReviewImageVO> getImgsByReviewIdsSorted(List<Integer> reviewIds);

    @Select("select * from nursing_home_review_image where nursing_home_review_id = #{reviewId}")
    List<NursingHomeReviewImage> selectByReviewId(Integer reviewId);

    @Delete("delete from nursing_home_review_image where nursing_home_review_id = #{reviewId}")
    void deleteByReviewId(Integer reviewId);

    @AutoFill(value = OperationType.INSERT)
    void insertBatch(List<NursingHomeReviewImage> nursingHomeReviewImageList);
}
